home *** CD-ROM | disk | FTP | other *** search
- Path: quark.enet.dec.com!LIONEL
- From: lionel@quark.enet.dec.com (Steve Lionel)
- Newsgroups: comp.lang.c++,comp.lang.fortran
- Subject: Re: Calling C++ from FORTRAN on VMS
- Date: 17 Feb 1996 02:00:06 GMT
- Organization: Digital Equipment Corporation - Nashua, NH
- Message-ID: <4g3cr6$btn@zk2nws.zko.dec.com>
- References: <31239D17.3159@stsci.edu>,<1996Feb15.195246.1@sldb6.slac.stanford.edu>
- Reply-To: lionel@quark.enet.dec.com
- NNTP-Posting-Host: quark.zko.dec.com
-
- In article <31239D17.3159@stsci.edu>, Scott Stallcup
- <stallcup@stsci.edu> writes:
- >> I need to call a C++ routine from a FORTRAN routine on both
- >> VAX/VMS and AXP/VMS platforms.
- >
- >> The C++ documentation fails to mention mixed langage programs
- >> (other than calling C from C++)...
- >>
- >> Given the following example code, what compiler/linker options
- >> will resolve the c++ reference ?
- >>
- >> program tfor
- >> call tcxx ()
- >> end
- >>
- >> #include <stdio.h>
- >>
- >> void tcxx (void)
- >> {
- >> printf ("Hello World\n");
- >> }
-
- If you've got a current version (6.2 or later - 6,2 was released in 1994) of
- DEC Fortran on either platform, do this:
-
- program tfor
- cdec$ alias tcxx, 'tcxx'
- call tcxx
- end
-
- For more info on the CDEC$ ALIAS directive, see the DEC Fortran Release Notes
- (it may be in the Language Reference Manual, depending on what edition you
- have) or HELP FORTRAN Statements Directive_Statements. See the DEC Fortran
- User Manual for more information on mixed-language programming.
-
- Steve Lionel Mail: lionel@quark.enet.dec.com
- Fortran Development WWW: http://www.digital.com/info/slionel.html
- Digital Equipment Corporation CompuServe: 75263,3001
- 110 Spit Brook Road, ZKO2-3/N30
- Nashua, NH 03062-2698 "Free advice is worth every cent"
-
- For information on Digital Fortran 90, see http://www.digital.com/info/hpc/f90/
-